from django.http import HttpResponse ,HttpResponseRedirect
from django.template import RequestContext, loader


def index(request):
    try:
        if request.session['user_id'] and request.session['first_name'] and request.session['last_name']:
            return HttpResponseRedirect('/')
    except:
        template = loader.get_template('register/index.html')
        context = RequestContext(request, {
            'isLogin': 0,
        })
        return HttpResponse(template.render(context))